/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.javanile.me.chessengine;

/**
 *
 * @author cicciodarkast
 */
public class SquaresLoop {
	
	private Node node;
	private int index;
	private int square;
	
	public SquaresLoop(Node n) {
		node = n;
		index = -1;
	}
	
	public boolean next() {
		index++;
		if (node.getTurn()==1) {
			square = Constants.BOARD0[index];
		} else {
			square = Constants.BOARD1[index];
		}
		node.setFocusSquare(square);
		return index<64;
	}
	
	public void dump() {
		dump("");		
	}
	
	public void dump(int value) {
		dump(""+value);				
	}
	
	public void dump(String text) {
		System.out.println(""+Square.toString(square)+": "+text);
	}
}
